package no.gnet.edvd;

import java.util.List;

import no.gnet.edvd.engines.EventOdds;
import no.gnet.edvd.feed.types.RemoteMatch;
import no.gnet.edvd.statemachine.BetState;
import no.gnet.edvd.types.Activity;
import no.gnet.edvd.types.ActivityType;
import no.gnet.edvd.types.Bet;
import no.gnet.edvd.types.Category;
import no.gnet.edvd.types.Comment;
import no.gnet.edvd.types.Currency;
import no.gnet.edvd.types.Event;
import no.gnet.edvd.types.EventType;
import no.gnet.edvd.types.FacebookUser;
import no.gnet.edvd.types.MatchEvent;
import no.gnet.edvd.types.Option;
import no.gnet.edvd.types.PaymentAccount;
import no.gnet.edvd.types.Player;
import no.gnet.edvd.types.Transfer;
import no.gnet.edvd.types.Wallet;


public interface DataStore {
	
	public int placeBet(Bet bet);
	public void updateBet(Bet bet);
	public Bet getBet(Bet bet);
	public List<Bet> getBetsForEvent(Event event);
	public List<Bet> getBetsForEvent(int eventid);	
	public Event storeEvent(Event event);
	public void updateEvent(Event event);
	public abstract List<Event> listEvents(boolean populateWithLikers);	
	public void insertCurrency(Currency currency);
	public Player storePlayer(Player player);
	public Player storePlayerWithPassword(Player player, String hashedpw);
	public boolean playerExists(Player player);
	public Player getPlayer(Player player);
	public Player getPlayer(int playerid);
	public abstract void placeBets(Bet... bets);
	public boolean currenciesEstablished();
	public abstract List<Option> getOptionsForEvent(int eventid);
	public Event getBettableEvent(int iid);
	public Option getOption(int optionid);
	public boolean eventTypesEstablished();
	public void insertEventType(EventType centrallyManaged);
	public FacebookUser getFBUser(String fbUserID, String email);
	public FacebookUser insertFBUser(FacebookUser fbUser);
	public String getHashedPasswordForUser(String email);
	public void deleteTestUsers(String string);
	public void likeEvent(int eventid, Player player);
	public int getLikesForEvent(int eventid);
	public boolean hasLiked(int eventid, int playerid);
	public void addComment(Player player, int event, String comment);
	public List<Comment> loadCommentsForEvent(int event);
	public List<Bet> getUserBets(int id);
	List<Bet> getAllBetsForPlayer(int playerid);
	public Wallet getWalletForUser(int id);
	public int createEmptyStartupWalletForUser(Player player);
	public void deletePlayer(int uid);
	public void deletePlayerWithEmail(String email);
	public void updateWalletForUser(Wallet w, Player player);
	public boolean categoriesEstablished();
	public void insertCategory(Category cat);
	public List<String> getTagsForEvent(int eventid);
	public void addTagsForEvent(int id, List<String> newtags);
	public List<Activity> getActivityLogForPlayer(Player gautePlayer);
	public void logActivity(ActivityType type, String text, Player player);
	public void activateEvent(int eventid);
	public List<Event> getEventsInState(BetState state);
	public List<Event> getEventsOwnedBy(int playerid);
	public void transitionTo(Event event, BetState state);
	public List<Event> betsToClose();
	public void betsClosed(List<Event> events);
	public List<Event> betsEventTimePassed();
	public void eventTimePassed(List<Event> events);
	public Option getWinnerForEvent(Event event);
	public Event getEventForDecision(int iid);
	public void setWinnerForEvent(int eventid, int winner);
	public double settleBet(Bet bet,EventOdds eodds);
	public void storeImportedMatchEvent(MatchEvent matchEvent, RemoteMatch rmatch);
	public void storeTransfer(Transfer transfer);
	public List<Transfer> getUnsettledTransfersForUser(int player_id);
	public void setPaidTransfer(int transferid);
	public PaymentAccount getPaymentAccountForUser(int player_id);
	public void setPaymentAccountForUser(int player_id, String email);
	public Event setMatchResult(int importedmatchid, String result);
	public String getMatchResult(int importedmatchid);
	public void setPaymode(int playerid,boolean p2p);
	public void activatePlayer(int playerid);
	public boolean isActivated(int playerid);
}
